# 计算器静态实现
class MyMath:
    @staticmethod
    def add(a, b):
        return a + b

    @staticmethod
    def sub(a, b):
        return a - b

    @staticmethod
    def mul(a, b):
        return a * b

    @staticmethod
    def div(a, b):
        return a / b

    @staticmethod
    def exdiv(a, b):
        return a // b

    @staticmethod
    def rem(a, b):
        return a % b

    @staticmethod
    def pow(a, b):
        return a ** b

print(MyMath.mul(1,2))

# 类进阶练习
class Person:
    earth_creature = True
    __gender = None
    def eat(self):
        print("I can eat")
    def sleep(self):
        print("I can sleep")
    def __init__(self, name, age):
        self.name = name
        self.__age = age

    @classmethod
    def __new__(cls, *args, **kwargs):
        print("I am smart")
        return super().__new__(cls)

    def __str__(self):
        return f"我的名字是{self.name},年龄是{self.__age}"

jack = Person("jack", 22)
jack._Person__gender = "Man"
print(jack._Person__gender)
print(jack)